package gameComponents;
/**
 * Represents a user during game play
 * A Player is made up of a HashMap of keys (the string representation of each piece ie 
 * King = "K"), and an ArrayList of Pieces as the values (since there are a different
 * number of each type of piece for a player).
 * 
 */
import gamePieces.Piece;

import java.util.ArrayList;
import java.util.HashMap;



public class Player {

	private HashMap<String, ArrayList<Piece>> pieces;
	private int id;
	
	/**
	 * Constructor for Player objects. Sets up HashMap with empty keys
	 * for all its pieces.
	 * 
	 * @param i - the id of the player (ie 1 or 2)
	 * @author Sabrina Gaudreau, Vivian Andreeva
	 */
	public Player(int i) {
		pieces = new HashMap<String, ArrayList<Piece>>();
		pieces.put("K", new ArrayList<Piece>());
		pieces.put("B", new ArrayList<Piece>());
		pieces.put("R", new ArrayList<Piece>());
		pieces.put("N", new ArrayList<Piece>());
		pieces.put("Q", new ArrayList<Piece>());
		pieces.put("P", new ArrayList<Piece>());
		// Identification names the player as player 1 or player 2.
		id = i;
	}
	
	/**
	 * Returns this player's HashMap of pieces.
	 * 
	 * @author Sabrina Gaudreau, Vivian Andreeva
	 * @return HashMap of Player's pieces
	 */
	public HashMap<String, ArrayList<Piece>> returnMap() {
		return this.pieces;
	}
	
	/**
	 * Returns this player's identification.
	 * @author Sabrina Gaudreau, Vivian Andreeva
	 * @return the int id of the Player
	 */
	public int getId() {
		return id;
	}
}
